package top.dotgo.model.biz.bean;

import cn.hutool.core.bean.BeanUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import top.dotgo.model.IBaseBean;
import top.dotgo.model.biz.BizUserEntity;
import top.dotgo.model.sys.bean.SysAccountBean;

import java.io.Serializable;

/**
 * 用户信息表(BizUser)对象bean
 *
 * @author jornl
 * @date 2020-04-15 10:21:18
 */
@Getter
@Setter
@Accessors(chain = true)
public class BizUserBean extends BizUserEntity implements IBaseBean<BizUserEntity>, Serializable {


    /**
     * 账号信息
     */
    private SysAccountBean account;

    public static BizUserBean bean(BizUserEntity entity) {
        BizUserBean bean = new BizUserBean();
        BeanUtil.copyProperties(entity, bean);

        return bean;
    }

    @Override
    public BizUserEntity entity() {
        BizUserEntity entity = new BizUserEntity();
        BeanUtil.copyProperties(this, entity);
        return entity;
    }


}
